<template>
  <div class="progress-box" :style="{ width: width ? width + 'px' : '100%','padding-top':pt+'px' }">
    <div class="progress-num f-j-sb-a-c">
      <span>已上传: {{ uploadSize.uploadSize }}/{{ uploadSize.size }}</span>
      <span> {{ progress }}% </span>
    </div>
    <div class="progress" :style="{ width: width ? width + 'px' : '100%' }">
      <div class="progress-line" :style="{ width: progress + '%' }"></div>
    </div>
  </div>
</template>
<script>
import { useStore } from "vuex";
import { useRouter } from "vue-router";
import {
  defineComponent,
  reactive,
  toRefs,
  onUnmounted,
  onMounted,
  computed,
  getCurrentInstance,
  watch,
} from "vue";
export default defineComponent({
  props: {
    uploadSize: {
      type: Object,
      default: () => {},
    },
    progress: {
      type: [String, Number],
      default: 0,
    },
    width: {
      type: Number,
      default: 0,
    },
    pt:{
        type:Number,
        default:40
    }
  },
  setup(props, { attrs, slots, emit }) {
    const router = useRouter();
    const { proxy } = getCurrentInstance();
    const store = useStore();
    let data = reactive({
      progressNum: 0,
    });

    return {
      ...toRefs(data),
    };
  },
});
</script>
<style lang="scss" scoped>
// .upload-progress {
  .progress-box {
    // padding-top: 40px;
    // width:100%;
    .progress-num {
      color: #656f79;
      font-size: 14px;
      padding-bottom: 10px;
    }
    .progress {
      //   width: 433px;
      height: 8px;
      background: #eef3f6;
      border-radius: 4px;
      position: relative;

      .progress-line {
        height: 8px;
        position: absolute;
        left: 0;
        top: 0;
        border-radius: 4px;
        background: #64c8dc;
        transition: all 0.1s;
      }
    }
  }
// }
</style>
